PGetLineBreakLoc

Gets the number of line breaks in the highlighted text and gets the type (e.g., text wrap, end of line, tab, soft return, or hard return), height (line depth), line width, and character count since the last line break for each.


Query results

PGetLineBreakLoc is a subclass of PListQuery. This query returns a list of information. Make sure that PListQuery::Count() > 0 before referencing these fields.

short nCharCount;

Number of characters (including line breaks) since last line break (or since the beginning of selection).
short cLineBreakType;
0 for automatic text wrap around a graphic
1 for automatic text wrap at end of a line
2 for end of paragraph (hard return) or extra space between paragraphs
3 for tab
4 for soft return (Shift + Return)
5 for end of selection
long nLineHeight;
Height of line in twips
long nComposeWidth;
Width of composed line in twips
Several lines selected. Be careful not to select too much text; this query can return a large amount of data, especially if the text contains numerous tabs. If your plug-in, rather than PageMaker, allocates the reply buffer but doesn't make it large enough, the query will fail.

nCharCount includes line breaks. If more than one type of line break occurs at the same point, PageMaker returns an nCharCount/nLineBreakType pair for each line break.

Extra space between paragraphs. PageMaker returns a separate nCharCount/cLineBreakType pair for extra space between paragraphs, setting nCharCount to 0 (zero) and cLineBreakType to 2. Extra space includes space added by the:

Layout view only. The PGetLineBreakLoc query works only in layout view.

Example. The following example gets the number of line breaks in the highlighted text, the type of break, the height, line width, and character count since last break.

PGetLineBreakLoc lineBrk;
lineBrk.Count();           // expected: 3
lineBrk.nCharCount;        // 1
lineBrk.cLineBreakType;    // 3 (tabs)
lineBrk.nLineHeight;       // 1
lineBrk.nComposeWidth;     // 0
lineBrk++;
lineBrk.nCharCount;        // 18
lineBrk.cLineBreakType;    // 1 (automatic text wrap)
lineBrk.nLineHeight;       // 300
lineBrk.nComposeWidth;     // 4334
lineBrk++;
lineBrk.nCharCount;        // 19
lineBrk.cLineBreakType;    // 5 (end of selection, no line break
lineBrk.nLineHeight;       // 300
lineBrk.nComposeWidth;     // 3754


See also

The PGetLineBreak and PGetTextRun queries


Copyright © 1996, Adobe Systems Incorporated. All rights reserved.

Comments or suggestions? Contact Adobe Developer Support